Skip to content

docs(rivetkit): document actor key overlap#4971

Closed
NathanFlurry wants to merge 1 commit intodepot-client/split-embedded-transportfrom
actor-keys/document-workflow-alarm-overlap
Closed

docs(rivetkit): document actor key overlap#4971
NathanFlurry wants to merge 1 commit intodepot-client/split-embedded-transportfrom
actor-keys/document-workflow-alarm-overlap

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 5, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 5, 2026

Code Review

Overview: This is a minimal documentation-only PR (2 lines added) that adds a comment explaining an intentional key overlap between LAST_PUSHED_ALARM and WORKFLOW_PREFIX, both of which use byte [6].


What the PR does

Documents a non-obvious invariant: LAST_PUSHED_ALARM stores its value at the exact key [6], while workflow data lives under keys prefixed with [6, 1, ...] (since WORKFLOW_STORAGE_PREFIX = [6] + STORAGE_VERSION.WORKFLOW=[1]). The two coexist because no KV operation uses WORKFLOW_PREFIX ([6]) directly as a scan prefix — it always goes through WORKFLOW_STORAGE_PREFIX ([6, 1]).


Feedback

Positive:

  • This is exactly the kind of non-obvious invariant the CLAUDE.md guidelines call out. The comment explains a hidden constraint that would surprise a reader.
  • The comment is placed correctly between the two constants and uses complete sentences per style conventions.
  • The explanation is accurate. STORAGE_VERSION.WORKFLOW = 1, so WORKFLOW_STORAGE_PREFIX = [6, 1], which does not collide with the exact [6] alarm key.

Suggestions:

  1. Implicit assumption about storage version. The comment says workflow data uses [6, 1, ...] but does not explain why — it is because STORAGE_VERSION.WORKFLOW = 1. If the storage version ever changes, the overlap logic changes. Consider referencing the version constant rather than hardcoding 1 in the comment to make this dependency explicit.

  2. Missing guard note. The invariant holds only as long as code scans with WORKFLOW_STORAGE_PREFIX ([6, 1]), not with the raw WORKFLOW_PREFIX ([6]). A future developer who naively prefix-scans on WORKFLOW_PREFIX would silently include the alarm timestamp in results. Adding a note — "never scan with WORKFLOW_PREFIX directly; always use WORKFLOW_STORAGE_PREFIX" — would make the constraint self-enforcing in review.

  3. Draft status. If the comment is complete, marking the PR ready would help with visibility.


Summary

The change is correct and useful. The suggestions above are optional quality improvements — the comment as-is is already better than nothing. No bugs, no performance or security implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant